﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using GalaxyTranslator.Model;
using GalaxyTranslator.ViewInterfaces;

namespace GalaxyTranslator.Presenters
{
	public class CustomerRegPresenter : BasePresenter<ICustomerRegView>
	{
		public CustomerRegPresenter(ICustomerRegView view) : base(view)
		{
		}

		public void InitView(bool isPostBack)
		{
			if (!isPostBack)
			{

			}
		}

		public void RegisterCustomer()
		{
			string username = View.UserName;
			string pass = View.Password;
			Membership.CreateUser(username, pass);
			Roles.AddUserToRole(username, DataLayer.CustomerRoleName);
		}
	}
}